{% extends 'layout.html' %}


{% block css %}
    <style>
        .icon-area ul {
            list-style-type: none;
            padding: 0;
        }

        .icon-area ul li {
            float: left;
            padding: 10px;
            padding-left: 0;
            width: 80px;
        }

        .icon-area ul li i {
            font-size: 18px;
            margin-left: 5px;
            color: #6d6565;
        }

    </style>
{% endblock %}

{% block content %}

    <div class="col-sm-12 " style="margin-top: 50px">
        <form class="form-horizontal" method="post" novalidate>
            {% csrf_token %}


            <div class="col-sm-10">
                <div class="form-group {% if form_obj.title.errors %} has-error {% endif %}">

                    <label for="{{ form_obj.title.id_for_label }}"
                           class="col-sm-2 control-label">{{ form_obj.title.label }}</label>
                    <div class="col-sm-10">
                        {{ form_obj.title }}
                        <span class="help-block">{{ form_obj.title.errors.0 }}</span>

                    </div>
                </div>
                <div class="form-group {% if form_obj.weight.errors %} has-error {% endif %}">

                    <label for="{{ form_obj.weight.id_for_label }}"
                           class="col-sm-2 control-label">{{ form_obj.weight.label }}</label>
                    <div class="col-sm-10">
                        {{ form_obj.weight }}
                        <span class="help-block">{{ form_obj.weight.errors.0 }}</span>

                    </div>
                </div>
                <div class="form-group icon-area {% if form_obj.icon.errors %} has-error {% endif %}">

                    <label for="{{ form_obj.icon.id_for_label }}"
                           class="col-sm-2 control-label">{{ form_obj.icon.label }}</label>
                    <div class="col-sm-10">
                        {{ form_obj.icon }}
                        <span class="help-block">{{ form_obj.icon.errors.0 }}</span>

                    </div>
                </div>

                <p class="text-center text-danger"> {{ form_obj.non_field_errors.0 }} </p>
            </div>

            <div class="col-sm-2">
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">保存</button>
                    </div>
                </div>
            </div>
        </form>
    </div>

{% endblock %}